<script setup>

const props = defineProps(['isOpenModal'])
const emit = defineEmits(['update:isOpenModal'])

function closeModal() {
    emit('update:isOpenModal', false)
}

</script>

<template>
    <div class="my-modal" :class="{ open: props.isOpenModal }" >
        <div class="content" >
            <div class="header" >
                <img src="/src/assets/images/student/close.svg" alt="Delete" @click="closeModal" />
            </div>
            <div class="main" >
                <slot></slot>
            </div>
        </div>
    </div>
</template>

<style scoped >
.my-modal {
    display: none;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
    z-index: 20;
}

.my-modal.open {
    display: flex;
    justify-content: center;
    align-items: start;
}

.content {
    width: 800px;
    background-color: #ffffff;
    border: none;
    border-radius: 10px;
    box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16);
    padding: 20px 50px;
    margin-top: 65px;
}

.header {
    display: flex;
    justify-content: end;
    align-items: center;
    margin-bottom: 30px;
}


.header>img {
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s;
}

.header>img:hover {
    transform: rotate(90deg);
}



</style>